<template>
  <div>
    <div class="header">
      <div class="header_box" @click="helpClick">
        <span class="icon_help"></span>
        <span>需要帮助？请联系我</span>
      </div>
      <div class="header_box" @click="strategyClick">
        <span class="icon_strategy"></span>
        <span>攻略</span>
      </div>
    </div>
    <div class="income_details_box">
      <div class="income_details" v-if="incomeShow">
        <div class="user_id">渠道ID:{{userinfo.tgid}}</div>
        <div class="user_yeas">
          <span>昨日收入</span>
          <span class="user_icon" @click="closeClick">
            <img src="@/assets/img/login/icon_close.png" alt="" v-if="!incomeShow">
            <img src="@/assets/img/login/icon_open.png" alt="" v-else>
          </span>
        </div>
        <div class="income_money">{{userinfo.yesterday_fee}}</div>
        <div class="user_footer">
          <div>
            <span>总流水</span>
            <span>{{userinfo.total}}</span>
          </div>
          <div>
            <span>提现余额</span>
            <span>{{userinfo.cash_remain}}</span>
          </div>
        </div>
      </div>
      <div class="income_details" v-else>
        <div class="user_id">渠道ID: ******</div>
        <div class="user_yeas">
          <span>昨日收入</span>
          <span class="user_icon" @click="closeClick">
            <img src="@/assets/img/login/icon_close.png" alt="" v-if="!incomeShow">
            <img src="@/assets/img/login/icon_open.png" alt="" v-else>
          </span>
        </div>
        <div class="income_money">******</div>
        <div class="user_footer">
          <div>
            <span>总流水</span>
            <span>******</span>
          </div>
          <div>
            <span>提现余额</span>
            <span>******</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {mapState} from 'vuex'
  export default {
    props: {
      userinfo: {
        type: Object,
        default() {
          return {}
        }
      }
    },
    data() {
      return {
        show: false
      }
    },
    methods: {
      closeClick() {
        this.$store.commit('$_incomeShow')
      },
      helpClick() {
        this.$emit('help-click',)
      },
      strategyClick() {
        this.$emit('strategy-click')
      }
    },
    computed: {
      ...mapState([
        'incomeShow'
      ])
    },
  }
</script>

<style scoped>
.header {
  width: 750px;
  height: 100px;
  box-sizing: border-box;
  padding: 0 35px;
  font-size: 25px;
  font-weight: bold;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #29209C;
}

.icon_help {
  display: inline-block;
  width: 31px;
  height: 31px;
  background: url('../../../assets/img/home/icon_help.png') no-repeat;
  background-size: 100%;
  margin-right: 12px;
}

.icon_strategy {
  display: inline-block;
  width: 31px;
  height: 31px;
  background: url('../../../assets/img/home/icon_strategy.png') no-repeat;
  background-size: 100%;
  margin-right: 5px;
}

.header_box {
  display: flex;
  align-items: center;
}

.income_details_box {
  width: 750px;
  height: 318px;
  box-sizing: border-box;
  padding: 0 62px;
  background-color: #29209C;
}

.income_details {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(-25deg, #4B6CF8, #97ABFF);
  border-radius: 30px 30px 0px 0px;
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.user_id {
  position: absolute;
  right: 0;
  top: 25px;
  height: 44px;
  padding: 0 22px;
  line-height: 44px;
  font-size: 24px;
  text-align: center;
  background: #FF9D00;
  border-radius: 22px 0px 0px 22px;
}

.user_yeas {
  display: flex;
  align-items: center;
  margin-top: 93px;
}

.income_money {
  font-size: 66px;
  font-weight: bold;
  color: #FFFFFF;
  line-height: 70px;
  margin-top: 10px;
}

.user_icon {
  width: 22px;
  height: 22px;
  margin-left: 10px;
}

.user_icon img {
  width: 22px;
  height: 22px;
}

.user_footer {
  position: absolute;
  box-sizing: border-box;
  padding: 20px 0;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100px;
  border-top: 1px solid #A7B8FF;
  display: flex;
}

.user_footer div {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}
</style>